/**
 * Copyright (c) 2003-2017 Ben Lau
 * All rights reserved.
 */
package proxy.cglib;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import proxy.statics.DBQuery;
import proxy.statics.IDBQuery;

/**
 * @author liubin
 *
 */
public class CglibDbQueryInterceptor implements MethodInterceptor {

	private IDBQuery real = null;
	
	@Override
	public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {

		if (real == null) {
			real = new DBQuery();
		}
		return real;

	}

}
